home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / xml4j.jar / com / ibm / xml / internal / UCSReader.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-08-30  |  8.5 KB  |  675 lines

  1. package com.ibm.xml.internal;
  2.  
  3. import com.ibm.xml.framework.ChunkyByteArray;
  4. import com.ibm.xml.framework.ChunkyCharArray;
  5. import com.ibm.xml.framework.ParserState;
  6. import com.ibm.xml.framework.ScanContentState;
  7. import com.ibm.xml.framework.StringPool;
  8. import com.ibm.xml.framework.StringProducer;
  9. import com.ibm.xml.framework.XMLDocumentHandler;
  10. import com.ibm.xml.framework.XMLErrorHandler;
  11. import com.ibm.xml.framework.XMLReader;
  12. import java.io.IOException;
  13.  
  14. final class UCSReader extends XMLReader implements StringProducer {
  15.    private static final boolean DEBUG_UTF16_BIG = false;
  16.    static final int E_UCS4B = 0;
  17.    static final int E_UCS4L = 1;
  18.    static final int E_UCS2B = 2;
  19.    static final int E_UCS2L = 3;
  20.    static final int E_UCS2B_NOBOM = 4;
  21.    static final int E_UCS2L_NOBOM = 5;
  22.    private ChunkyByteArray fData;
  23.    private int fEncoding = -1;
  24.    private StringPool fStringPool;
  25.    private XMLDocumentHandler fDocumentHandler;
  26.    private XMLErrorHandler fErrorHandler;
  27.    private int fBytesPerChar = -1;
  28.    private boolean fBigEndian = true;
  29.    private ChunkyCharArray fStringCharArray;
  30.    private static char[] fCharacters = new char[256];
  31.    private int fCharDataLength;
  32.  
  33.    UCSReader(ParserState var1, String var2, String var3, ChunkyByteArray var4, int var5) throws IOException {
  34.       super(var1, var2, var3);
  35.       super.fCurrentOffset = var5 != 2 && var5 != 3 ? 0 : 2;
  36.       this.fData = var4;
  37.       this.fEncoding = var5;
  38.       this.fStringPool = var1.cacheStringPool();
  39.       this.fDocumentHandler = var1.getDocumentHandler();
  40.       this.fErrorHandler = var1.getErrorHandler();
  41.       this.fBytesPerChar = this.fEncoding != 0 && this.fEncoding != 1 ? 2 : 4;
  42.       this.fBigEndian = this.fEncoding == 0 || this.fEncoding == 2 || this.fEncoding == 4;
  43.    }
  44.  
  45.    private int getChar(int var1) {
  46.       int var2 = this.fData.byteAt(var1++) & 255;
  47.       if (var2 == 255 && this.fData.atEOF(var1)) {
  48.          return -1;
  49.       } else {
  50.          int var3 = this.fData.byteAt(var1++) & 255;
  51.          if (this.fBytesPerChar == 4) {
  52.             int var4 = this.fData.byteAt(var1++) & 255;
  53.             int var5 = this.fData.byteAt(var1++) & 255;
  54.             return this.fBigEndian ? (var2 << 24) + (var3 << 16) + (var4 << 8) + var5 : (var5 << 24) + (var4 << 16) + (var3 << 8) + var2;
  55.          } else {
  56.             return this.fBigEndian ? (var2 << 8) + var3 : (var3 << 8) + var2;
  57.          }
  58.       }
  59.    }
  60.  
  61.    public int addString(int var1, int var2) {
  62.       return var2 == 0 ? 0 : this.fStringPool.addString(this, var1, var2);
  63.    }
  64.  
  65.    public int addSymbol(int var1, int var2) {
  66.       return var2 == 0 ? 0 : this.fStringPool.addSymbol(this, var1, var2, this.getHashcode(var1, var2));
  67.    }
  68.  
  69.    public void append(ChunkyCharArray var1, int var2, int var3) {
  70.       for(int var4 = var2 + var3; var2 < var4; var2 += this.fBytesPerChar) {
  71.          int var5 = this.getChar(var2);
  72.          var1.append((char)var5);
  73.       }
  74.  
  75.    }
  76.  
  77.    public String toString(int var1, int var2) {
  78.       if (this.fStringCharArray == null) {
  79.          this.fStringCharArray = new ChunkyCharArray(this.fStringPool);
  80.       }
  81.  
  82.       int var3 = this.fStringCharArray.length();
  83.       this.append(this.fStringCharArray, var1, var2);
  84.       int var4 = this.fStringCharArray.length() - var3;
  85.       int var5 = this.fStringCharArray.addString(var3, var4);
  86.       return this.fStringPool.toString(var5);
  87.    }
  88.  
  89.    private int getHashcode(int var1, int var2) {
  90.       int var3 = var1 + var2;
  91.       int var4 = 0;
  92.  
  93.       for(int var5 = 0; var1 < var3; var1 += this.fBytesPerChar) {
  94.          int var6 = this.getChar(var1);
  95.          var4 = StringHasher.hashChar(var4, var5++, var6);
  96.       }
  97.  
  98.       return StringHasher.finishHash(var4);
  99.    }
  100.  
  101.    public boolean equalsString(int var1, int var2, String var3, int var4) {
  102.       int var5 = var1 + var2;
  103.       int var6 = var4;
  104.  
  105.       for(int var7 = 0; var1 < var5; var1 += this.fBytesPerChar) {
  106.          if (var6-- == 0) {
  107.             return false;
  108.          }
  109.  
  110.          int var8 = this.getChar(var1);
  111.          if (var8 != var3.charAt(var7++)) {
  112.             return false;
  113.          }
  114.       }
  115.  
  116.       if (var6 != 0) {
  117.          return false;
  118.       } else {
  119.          return true;
  120.       }
  121.    }
  122.  
  123.    private void appendCharData(int var1) {
  124.       if (fCharacters.length == this.fCharDataLength) {
  125.          char[] var2 = new char[fCharacters.length * 2];
  126.          System.arraycopy(fCharacters, 0, var2, 0, fCharacters.length);
  127.          fCharacters = var2;
  128.       }
  129.  
  130.       fCharacters[this.fCharDataLength++] = (char)var1;
  131.    }
  132.  
  133.    public void callWSCharDataHandler(int var1, int var2, boolean var3) throws Exception {
  134.       for(int var4 = var1 + var2; var1 < var4; var1 += this.fBytesPerChar) {
  135.          int var5 = this.getChar(var1);
  136.          this.appendCharData(var5);
  137.       }
  138.  
  139.       if (this.fDocumentHandler.sendCharDataAsCharArray()) {
  140.          this.fDocumentHandler.ignorableWhitespace(fCharacters, 0, this.fCharDataLength, var3);
  141.       } else {
  142.          int var6 = this.fStringPool.addString(new String(fCharacters, 0, this.fCharDataLength));
  143.          this.fDocumentHandler.ignorableWhitespace(var6, var3);
  144.       }
  145.  
  146.       this.fCharDataLength = 0;
  147.    }
  148.  
  149.    public void callCharDataHandler(int var1, int var2, boolean var3) throws Exception {
  150.       for(int var4 = var1 + var2; var1 < var4; var1 += this.fBytesPerChar) {
  151.          int var5 = this.getChar(var1);
  152.          this.appendCharData(var5);
  153.       }
  154.  
  155.       if (this.fDocumentHandler.sendCharDataAsCharArray()) {
  156.          this.fDocumentHandler.characters(fCharacters, 0, this.fCharDataLength, var3);
  157.       } else {
  158.          int var6 = this.fStringPool.addString(new String(fCharacters, 0, this.fCharDataLength));
  159.          this.fDocumentHandler.characters(var6, var3);
  160.       }
  161.  
  162.       this.fCharDataLength = 0;
  163.    }
  164.  
  165.    public int skipOneChar() throws IOException {
  166.       super.fCurrentOffset += this.fBytesPerChar;
  167.       return super.fCurrentOffset;
  168.    }
  169.  
  170.    public int skipAsciiChar() throws IOException {
  171.       super.fCurrentOffset += this.fBytesPerChar;
  172.       return super.fCurrentOffset;
  173.    }
  174.  
  175.    public int skipToChar(char var1) throws IOException {
  176.       while(true) {
  177.          int var2 = this.getChar(super.fCurrentOffset);
  178.          if (var2 == var1) {
  179.             return super.fCurrentOffset;
  180.          }
  181.  
  182.          super.fCurrentOffset += this.fBytesPerChar;
  183.       }
  184.    }
  185.  
  186.    public int skipPastChar(char var1) throws IOException {
  187.       int var2;
  188.       do {
  189.          var2 = this.getChar(super.fCurrentOffset);
  190.          super.fCurrentOffset += this.fBytesPerChar;
  191.       } while(var2 != var1);
  192.  
  193.       return super.fCurrentOffset;
  194.    }
  195.  
  196.    public boolean skippedValidChar() throws IOException {
  197.       int var1 = this.getChar(super.fCurrentOffset);
  198.       super.fCurrentOffset += this.fBytesPerChar;
  199.       if (var1 < 32) {
  200.          if (var1 == 9) {
  201.             ++super.fCharacterCounter;
  202.             return true;
  203.          } else if (var1 == 10) {
  204.             ++super.fLinefeedCounter;
  205.             super.fCharacterCounter = 1;
  206.             return true;
  207.          } else if (var1 == 13) {
  208.             ++super.fCarriageReturnCounter;
  209.             super.fCharacterCounter = 1;
  210.             return true;
  211.          } else {
  212.             --super.fCurrentOffset;
  213.             if (var1 == -1) {
  214.                this.fData.checkEOF(super.fCurrentOffset + 1);
  215.             }
  216.  
  217.             return false;
  218.          }
  219.       } else {
  220.          ++super.fCharacterCounter;
  221.          if (var1 <= 55295) {
  222.             return true;
  223.          } else if (var1 <= 57343) {
  224.             ++super.fCurrentOffset;
  225.             return true;
  226.          } else if (var1 <= 65533) {
  227.             return true;
  228.          } else {
  229.             --super.fCharacterCounter;
  230.             super.fCurrentOffset -= this.fBytesPerChar;
  231.             return false;
  232.          }
  233.       }
  234.    }
  235.  
  236.    public boolean lookingAtValidChar() throws IOException {
  237.       int var1 = this.getChar(super.fCurrentOffset);
  238.       if (var1 < 32) {
  239.          if (var1 == -1) {
  240.             this.fData.checkEOF(super.fCurrentOffset + 1);
  241.          }
  242.  
  243.          return var1 == 9 || var1 == 10 || var1 == 13;
  244.       } else {
  245.          return var1 <= 55295 || var1 >= 57344 && (var1 <= 65533 || var1 >= 65536 && var1 <= 1114111);
  246.       }
  247.    }
  248.  
  249.    public int skipInvalidChar(int var1) throws Exception {
  250.       int var2 = this.getChar(super.fCurrentOffset);
  251.       super.fCurrentOffset += this.fBytesPerChar;
  252.       switch (var1) {
  253.          case 43:
  254.             String var6 = (new Character((char)var2)).toString();
  255.             String var4 = Integer.toHexString(var2);
  256.             this.fErrorHandler.error2(var1, this.fStringPool.addString(var6), this.fStringPool.addString(var4));
  257.             break;
  258.          case 63:
  259.          case 85:
  260.             String var5 = Integer.toHexString(var2);
  261.             this.fErrorHandler.error1(var1, this.fStringPool.addString(var5));
  262.             break;
  263.          case 80:
  264.          case 82:
  265.          case 110:
  266.             String var3 = (new Character((char)var2)).toString();
  267.             this.fErrorHandler.error1(var1, this.fStringPool.addString(var3));
  268.       }
  269.  
  270.       return super.fCurrentOffset;
  271.    }
  272.  
  273.    public boolean skippedChar(char var1) throws IOException {
  274.       int var2 = this.getChar(super.fCurrentOffset);
  275.       if (var2 == var1) {
  276.          super.fCurrentOffset += this.fBytesPerChar;
  277.          return true;
  278.       } else {
  279.          return false;
  280.       }
  281.    }
  282.  
  283.    public boolean lookingAtChar(char var1) throws IOException {
  284.       return var1 == this.getChar(super.fCurrentOffset);
  285.    }
  286.  
  287.    public boolean skippedSpace() throws IOException {
  288.       int var1 = this.getChar(super.fCurrentOffset);
  289.       if (var1 != 32 && var1 != 9 && var1 != 10 && var1 != 13) {
  290.          return false;
  291.       } else {
  292.          super.fCurrentOffset += this.fBytesPerChar;
  293.          return true;
  294.       }
  295.    }
  296.  
  297.    public boolean lookingAtSpace() throws IOException {
  298.       int var1 = this.getChar(super.fCurrentOffset);
  299.       return var1 == 32 || var1 == 9 || var1 == 10 || var1 == 13;
  300.    }
  301.  
  302.    public int skipPastSpaces() throws IOException {
  303.       while(true) {
  304.          int var1 = this.getChar(super.fCurrentOffset);
  305.          if (var1 != 32 && var1 != 9 && var1 != 10 && var1 != 13) {
  306.             return super.fCurrentOffset;
  307.          }
  308.  
  309.          super.fCurrentOffset += this.fBytesPerChar;
  310.       }
  311.    }
  312.  
  313.    public int skipDecimalDigit() throws IOException {
  314.       int var1 = this.getChar(super.fCurrentOffset);
  315.       if (var1 >= 48 && var1 <= 57) {
  316.          super.fCurrentOffset += this.fBytesPerChar;
  317.          ++super.fCharacterCounter;
  318.          return var1 - 48;
  319.       } else {
  320.          return -1;
  321.       }
  322.    }
  323.  
  324.    public int skipHexDigit() throws IOException {
  325.       int var1 = this.getChar(super.fCurrentOffset);
  326.       if (var1 <= 102 && XMLReader.fgAsciiXDigitChar[var1] != 0) {
  327.          super.fCurrentOffset += this.fBytesPerChar;
  328.          ++super.fCharacterCounter;
  329.          return var1 - (var1 < 65 ? 48 : (var1 < 97 ? 65 : 97) - 10);
  330.       } else {
  331.          return -1;
  332.       }
  333.    }
  334.  
  335.    public boolean skippedAlpha() throws IOException {
  336.       int var1 = this.getChar(super.fCurrentOffset);
  337.       if (var1 <= 122 && XMLReader.fgAsciiAlphaChar[var1] == 1) {
  338.          super.fCurrentOffset += this.fBytesPerChar;
  339.          ++super.fCharacterCounter;
  340.          return true;
  341.       } else {
  342.          return false;
  343.       }
  344.    }
  345.  
  346.    private boolean skippedCharWithFlag(byte var1) {
  347.       int var2 = this.getChar(super.fCurrentOffset);
  348.       if (var2 < 128 && (XMLReader.fgCharFlags[var2] & var1) != 0) {
  349.          super.fCurrentOffset += this.fBytesPerChar;
  350.          ++super.fCharacterCounter;
  351.          return true;
  352.       } else {
  353.          return false;
  354.       }
  355.    }
  356.  
  357.    public final boolean skippedVersionNum() {
  358.       return this.skippedCharWithFlag((byte)1);
  359.    }
  360.  
  361.    public final boolean skippedEncName() {
  362.       return this.skippedCharWithFlag((byte)2);
  363.    }
  364.  
  365.    public final boolean skippedPubidChar() {
  366.       int var1 = this.getChar(super.fCurrentOffset);
  367.       if (var1 < 128) {
  368.          if ((XMLReader.fgCharFlags[var1] & 4) != 0) {
  369.             super.fCurrentOffset += this.fBytesPerChar;
  370.             ++super.fCharacterCounter;
  371.             return true;
  372.          }
  373.  
  374.          if (var1 == 10) {
  375.             super.fCurrentOffset += this.fBytesPerChar;
  376.             ++super.fLinefeedCounter;
  377.             super.fCharacterCounter = 1;
  378.             return true;
  379.          }
  380.  
  381.          if (var1 == 13) {
  382.             super.fCurrentOffset += this.fBytesPerChar;
  383.             ++super.fCarriageReturnCounter;
  384.             super.fCharacterCounter = 1;
  385.             return true;
  386.          }
  387.       }
  388.  
  389.       return false;
  390.    }
  391.  
  392.    public boolean skippedString(char[] var1) throws IOException {
  393.       int var2 = super.fCurrentOffset;
  394.  
  395.       for(int var3 = 0; var3 < var1.length; ++var3) {
  396.          if (this.getChar(var2) != var1[var3]) {
  397.             return false;
  398.          }
  399.  
  400.          var2 += this.fBytesPerChar;
  401.       }
  402.  
  403.       super.fCurrentOffset = var2;
  404.       super.fCharacterCounter += var1.length;
  405.       return true;
  406.    }
  407.  
  408.    public int scanName(char var1, int var2) throws IOException {
  409.       int var3 = super.fCurrentOffset;
  410.       int var4 = this.skipPastName(var1) - var3;
  411.       if (var4 == 0) {
  412.          return -1;
  413.       } else {
  414.          int var5 = var4 == 0 ? 0 : this.fStringPool.addSymbol(this, var3, var4, this.getHashcode(var3, var4));
  415.          return var2 != -1 && var2 != var5 ? -1 : var5;
  416.       }
  417.    }
  418.  
  419.    public int skipPastName(char var1) throws IOException {
  420.       int var2 = this.getChar(super.fCurrentOffset);
  421.       if ((XMLReader.fgCharFlags[var2] & 16) == 0) {
  422.          return super.fCurrentOffset;
  423.       } else {
  424.          do {
  425.             super.fCurrentOffset += this.fBytesPerChar;
  426.             ++super.fCharacterCounter;
  427.             var2 = this.getChar(super.fCurrentOffset);
  428.             if (var1 == var2) {
  429.                return super.fCurrentOffset;
  430.             }
  431.          } while((XMLReader.fgCharFlags[var2] & 32) != 0);
  432.  
  433.          return super.fCurrentOffset;
  434.       }
  435.    }
  436.  
  437.    public int skipPastNmtoken(char var1) throws IOException {
  438.       for(int var2 = this.getChar(super.fCurrentOffset); var1 != var2; var2 = this.getChar(super.fCurrentOffset)) {
  439.          if ((XMLReader.fgCharFlags[var2] & 32) == 0) {
  440.             return super.fCurrentOffset;
  441.          }
  442.  
  443.          super.fCurrentOffset += this.fBytesPerChar;
  444.          ++super.fCharacterCounter;
  445.       }
  446.  
  447.       return super.fCurrentOffset;
  448.    }
  449.  
  450.    public int scanContent(ScanContentState var1) throws Exception {
  451.       int var2 = super.fCurrentOffset;
  452.       int var3 = this.getChar(super.fCurrentOffset);
  453.       super.fCurrentOffset += this.fBytesPerChar;
  454.       if (var3 < 128) {
  455.          if (var3 == -1) {
  456.             super.fCurrentOffset -= this.fBytesPerChar;
  457.             return 4;
  458.          }
  459.  
  460.          byte var4 = XMLReader.fgCharFlags[var3];
  461.          if ((var4 & 8) == 0 && var3 != 10 && var3 != 13) {
  462.             if (var3 == 60) {
  463.                ++super.fCharacterCounter;
  464.                return 1;
  465.             }
  466.  
  467.             if (var3 == 38) {
  468.                ++super.fCharacterCounter;
  469.                return 2;
  470.             }
  471.  
  472.             if (var3 != 93) {
  473.                super.fCurrentOffset -= this.fBytesPerChar;
  474.                return 4;
  475.             }
  476.  
  477.             if (this.getChar(super.fCurrentOffset) == 93 && this.getChar(super.fCurrentOffset + this.fBytesPerChar) == 62) {
  478.                super.fCharacterCounter += 3;
  479.                super.fCurrentOffset += 2 * this.fBytesPerChar;
  480.                return 3;
  481.             }
  482.          } else if (var3 == 32 || var3 == 9 || var3 == 10 || var3 == 13) {
  483.             do {
  484.                if (var3 == 10) {
  485.                   ++super.fLinefeedCounter;
  486.                   super.fCharacterCounter = 1;
  487.                } else if (var3 == 13) {
  488.                   ++super.fCarriageReturnCounter;
  489.                   super.fCharacterCounter = 1;
  490.                } else {
  491.                   ++super.fCharacterCounter;
  492.                }
  493.  
  494.                var3 = this.getChar(super.fCurrentOffset);
  495.                super.fCurrentOffset += this.fBytesPerChar;
  496.             } while(var3 == 32 || var3 == 9 || var3 == 10 || var3 == 13);
  497.  
  498.             if (var3 < 128) {
  499.                if (var3 == -1) {
  500.                   super.fCurrentOffset -= this.fBytesPerChar;
  501.                   if (this.fDocumentHandler != null) {
  502.                      this.callWSCharDataHandler(var2, super.fCurrentOffset - var2, var1.inCDSect);
  503.                   }
  504.  
  505.                   return 28;
  506.                }
  507.  
  508.                var4 = XMLReader.fgCharFlags[var3];
  509.                if ((var4 & 8) == 0) {
  510.                   if (var3 == 60) {
  511.                      ++super.fCharacterCounter;
  512.                      if (this.fDocumentHandler != null) {
  513.                         this.callWSCharDataHandler(var2, super.fCurrentOffset - this.fBytesPerChar - var2, var1.inCDSect);
  514.                      }
  515.  
  516.                      return 25;
  517.                   }
  518.  
  519.                   if (var3 == 38) {
  520.                      ++super.fCharacterCounter;
  521.                      if (this.fDocumentHandler != null) {
  522.                         this.callWSCharDataHandler(var2, super.fCurrentOffset - this.fBytesPerChar - var2, var1.inCDSect);
  523.                      }
  524.  
  525.                      return 26;
  526.                   }
  527.  
  528.                   if (var3 != 93) {
  529.                      super.fCurrentOffset -= this.fBytesPerChar;
  530.                      if (this.fDocumentHandler != null) {
  531.                         this.callWSCharDataHandler(var2, super.fCurrentOffset - var2, var1.inCDSect);
  532.                      }
  533.  
  534.                      return 28;
  535.                   }
  536.  
  537.                   if (this.getChar(super.fCurrentOffset) == 93 && this.getChar(super.fCurrentOffset + this.fBytesPerChar) == 62) {
  538.                      if (this.fDocumentHandler != null) {
  539.                         this.callWSCharDataHandler(var2, super.fCurrentOffset - this.fBytesPerChar - var2, var1.inCDSect);
  540.                      }
  541.  
  542.                      super.fCharacterCounter += 3;
  543.                      super.fCurrentOffset += 2 * this.fBytesPerChar;
  544.                      return 27;
  545.                   }
  546.                }
  547.             } else if (var3 >= 55296 && var3 <= 57343) {
  548.                super.fCurrentOffset += this.fBytesPerChar;
  549.             } else if (var3 == 65534 || var3 == 65535) {
  550.                super.fCurrentOffset -= this.fBytesPerChar;
  551.                if (this.fDocumentHandler != null) {
  552.                   this.callWSCharDataHandler(var2, super.fCurrentOffset - var2, var1.inCDSect);
  553.                }
  554.  
  555.                return 28;
  556.             }
  557.          }
  558.       } else if (var3 >= 55296 && var3 <= 57343) {
  559.          super.fCurrentOffset += this.fBytesPerChar;
  560.       } else if (var3 == 65534 || var3 == 65535) {
  561.          super.fCurrentOffset -= this.fBytesPerChar;
  562.          return 4;
  563.       }
  564.  
  565.       ++super.fCharacterCounter;
  566.  
  567.       while(true) {
  568.          var3 = this.getChar(super.fCurrentOffset);
  569.          super.fCurrentOffset += this.fBytesPerChar;
  570.          if (var3 >= 128 || var3 < 0) {
  571.             break;
  572.          }
  573.  
  574.          byte var7 = XMLReader.fgCharFlags[var3];
  575.          if ((var7 & 8) == 0) {
  576.             if (var3 == 10) {
  577.                ++super.fLinefeedCounter;
  578.                super.fCharacterCounter = 1;
  579.             } else {
  580.                if (var3 != 13) {
  581.                   break;
  582.                }
  583.  
  584.                ++super.fCarriageReturnCounter;
  585.                super.fCharacterCounter = 1;
  586.             }
  587.          } else {
  588.             ++super.fCharacterCounter;
  589.          }
  590.       }
  591.  
  592.       while(true) {
  593.          if (var3 < 128) {
  594.             if (var3 == -1) {
  595.                super.fCurrentOffset -= this.fBytesPerChar;
  596.                if (this.fDocumentHandler != null) {
  597.                   this.callCharDataHandler(var2, super.fCurrentOffset - var2, var1.inCDSect);
  598.                }
  599.  
  600.                return 12;
  601.             }
  602.  
  603.             byte var8 = XMLReader.fgCharFlags[var3];
  604.             if ((var8 & 8) == 0) {
  605.                if (var3 == 60) {
  606.                   ++super.fCharacterCounter;
  607.                   if (this.fDocumentHandler != null) {
  608.                      this.callCharDataHandler(var2, super.fCurrentOffset - this.fBytesPerChar - var2, var1.inCDSect);
  609.                   }
  610.  
  611.                   return 9;
  612.                }
  613.  
  614.                if (var3 == 38) {
  615.                   ++super.fCharacterCounter;
  616.                   if (this.fDocumentHandler != null) {
  617.                      this.callCharDataHandler(var2, super.fCurrentOffset - this.fBytesPerChar - var2, var1.inCDSect);
  618.                   }
  619.  
  620.                   return 10;
  621.                }
  622.  
  623.                if (var3 == 10) {
  624.                   ++super.fLinefeedCounter;
  625.                   super.fCharacterCounter = 1;
  626.                } else if (var3 == 13) {
  627.                   ++super.fCarriageReturnCounter;
  628.                   super.fCharacterCounter = 1;
  629.                } else {
  630.                   if (var3 != 93) {
  631.                      super.fCurrentOffset -= this.fBytesPerChar;
  632.                      if (this.fDocumentHandler != null) {
  633.                         this.callCharDataHandler(var2, super.fCurrentOffset - var2, var1.inCDSect);
  634.                      }
  635.  
  636.                      return 12;
  637.                   }
  638.  
  639.                   if (this.getChar(super.fCurrentOffset) == 93 && this.getChar(super.fCurrentOffset + this.fBytesPerChar) == 62) {
  640.                      if (this.fDocumentHandler != null) {
  641.                         this.callCharDataHandler(var2, super.fCurrentOffset - this.fBytesPerChar - var2, var1.inCDSect);
  642.                      }
  643.  
  644.                      super.fCharacterCounter += 3;
  645.                      super.fCurrentOffset += 2 * this.fBytesPerChar;
  646.                      return 11;
  647.                   }
  648.  
  649.                   ++super.fCharacterCounter;
  650.                }
  651.             } else {
  652.                ++super.fCharacterCounter;
  653.             }
  654.          } else {
  655.             if (var3 >= 55296 && var3 <= 57343) {
  656.                ++super.fCharacterCounter;
  657.                super.fCurrentOffset += this.fBytesPerChar;
  658.             } else if (var3 == 65534 || var3 == 65535) {
  659.                super.fCurrentOffset -= this.fBytesPerChar;
  660.                if (this.fDocumentHandler != null) {
  661.                   this.callCharDataHandler(var2, super.fCurrentOffset - var2, var1.inCDSect);
  662.                }
  663.  
  664.                return 12;
  665.             }
  666.  
  667.             ++super.fCharacterCounter;
  668.          }
  669.  
  670.          var3 = this.getChar(super.fCurrentOffset);
  671.          super.fCurrentOffset += this.fBytesPerChar;
  672.       }
  673.    }
  674. }
  675.